package sys.model;

import com.util.DateUtil;

import java.util.Date;

public class User {
    private Integer id;

    private String username;

    private String realname;

    private String password;

    private String url;

    private Integer usertype;

    private String phone;

    private String email;

    private Date birthday;

    private Date intime;

    private Integer majorid;

    public Integer getId() {

        return id;

    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username == null ? null : username.trim();
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password == null ? null : password.trim();
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Integer getUsertype() {
        return usertype;
    }

    public void setUsertype(Integer usertype) {

        this.usertype = usertype;

    }

    public String getUserTypeTo(){
        String usertypeto="";
        if(usertype!=null) {
            if (usertype == 1) {
                usertypeto = "管理员";
            } else if (usertype == 2) {
                usertypeto = "专业负责人";
            } else if (usertype == 3) {
                usertypeto = "校友";
            }
        }
        return usertypeto;
    }
    public String getIntimeTo(){
        return DateUtil.DateToSimpleString(intime);
    }
    public void setIntimeTo(String time){

        intime= DateUtil.StringToSimpleDate(time);
    }
    public String getBirthdayTo(){
        return DateUtil.DateToSimpleString(birthday);
    }
    public void setBirthdayTo(String time){
        birthday= DateUtil.StringToSimpleDate(time);
    }
    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone == null ? null : phone.trim();
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email == null ? null : email.trim();
    }

    public Date getBirthday() {

        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public Date getIntime() {
        return intime;
    }

    public void setIntime(Date intime) {
        this.intime = intime;

    }


    public Integer getMajorid() {

        return majorid;
    }

    public void setMajorid(Integer majorid) {
        this.majorid = majorid;

    }

    public String getMajor(){
        String s="";
        if(majorid!=null){
            if(majorid==1){
                s="计算机专业";
            }
        }
        return s;
    }

    public String getRealname() {
        return realname;
    }

    public void setRealname(String realname) {

        this.realname = realname;
    }
}